Add default to TypeFoldable::fold_with - #159584
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
23af8de to
a915f8c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// infallible folders. Do not override this method, to ensure coherence | ||
| /// with `try_super_fold_with`. | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self { |
There was a problem hiding this comment.
Did you test #[inline] on it locally?
| /// the behavior in sync across functions. | ||
| fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| #[inline] | ||
| fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self { |
There was a problem hiding this comment.
(Ideally we would mark this final but unfortunately this crate needs to be able to compile on stable, too. We could make it conditional on feature="nightly" using an identity macro but at this point we should just give up I guess.)
| /// infallible folders. Do not override this method, to ensure coherence | ||
| /// with `try_super_fold_with`. | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self { |
a915f8c to
12bd193
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add default to `TypeFoldable::fold_with`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (72fafa6): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary 7.2%, secondary 8.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 469.882s -> 474.787s (1.04%) |
TypeFoldable::fold_withdelegates toTypeFoldable::try_fold_withwith an infallible error type.